<%-- 
    Document   : EXPEDIENTES
    Created on : 16/08/2013, 01:16:44 PM
    Author     : ALAN GONZALEZ 
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<jsp:include page = "metadatos.jsp" flush = "True" />
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Clientes</h1>
        <fieldset>
            <legend> Filtrar </legend>
            <form method="post" action="../OpticaAdmin?action=expedientesFiltro">
                <table>
                    <tr>
                        <td>Nombre(S): <input type="text" name="filtroNombre"/></td>
                        <td>Apellido Paterno: <input type="text" name="filtroApPaterno"/></td>
                        <td>Apellido Materno: <input type="text" name="filtroApMaterno"/></td>
                        <td><input type="submit" value="Buscar Cliente"/></td>
                    </tr>
                </table>
            </form>
        </fieldset>
        <fieldset>
            <legend>CLIENTES</legend>
            <Input type="button" value="NUEVO CLIENTE" onclick="popup('../OpticaAdmin?action=nuevoCliente&index=1', 800, 500);"/>
            <table width="700" border="1">
                <tr>
                    <td>Nombre Completo</td>
                    <td>Edad</td>
                    <td>Telefono</td>
                    <td>Direccion</td>
                    <td>Ver Historial Clinico</td>
                    <td>Eliminar</td>
                <tr>
                    <c:forEach items="${principalOptica.pasientes}" var="regs">
                    <tr>
                        <td><c:out value="${regs.nombreCompleto}"/></td>
                        <td><c:out value="${regs.edad}"/></td>
                        <td><c:out value="${regs.telefono}"/></td>
                        <td><c:out value="${regs.direccion}"/></td>
                        <td><input type ="button" value="VER HISTORIAL" onclick="location.href = '../OpticaAdmin?action=expedClientes&idCliente=<c:out value="${regs.idCliente}"/>'"/></td>
                        <td><div align="center"><img src="../resources/delete-icon.png" width="20" height="20" onclick="location.href = '../OpticaAdmin?action=borrarCliente&id=<c:out value="${regs.idCliente}"/>'"/></div></td>
                    </tr>
                </c:forEach>
            </table>
        </fieldset>
    </body>
</html>
<jsp:include page = "pie.jsp" flush = "True" />